ComboBox: Do not select item before menu realised
authorDaniel Boles <dboles@src.gnome.org>
Thu, 1 Dec 2016 12:38:43 +0000 (12:38 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Thu, 1 Dec 2016 12:46:12 +0000 (12:46 +0000)
commite723fd6a238d52f9c458e8d442f2327644ab5016
tree08cf854b4a3f2d5a664dbf00d4ab4188acd292f0
parenta72dbeba0604698a6041cfb63548cbba98381715
ComboBox: Do not select item before menu realised

For a menu mode CB with wrap_width == 0 and an active item, that item is
selected in gtk_combo_box_menu_popup. Selection causes the MenuShell to
activate and hence take a grab. This was done before the menu was popped
up. A patch distributed in Debian sid - after being proposed on our BZ -
revealed that on the 1st popup of any such ComboBox, within grab_add,
the MenuShell's toplevel's GdkWindow is NULL. This causes a Gdk-CRITICAL
assertion fail on the 1st time opening any such CB, on Debian and if
that patch were merged to GTK+. By selecting after popup, we ensure the
MenuShell is realised before its grab_add and so avoid the critical.

https://bugzilla.gnome.org/show_bug.cgi?id=771242
gtk/gtkcombobox.c